<div class="modal-header">
    <h3 class="modal-title">{{title}}</h3>
</div>
<div class="modal-body">
    <form class="form form-horizontal" name="$parent.form" ng-submit="submit()">
        <div class="alert alert-warning" ng-show="object.unknown" role="alert">
            <strong> Leshan does not known object {{object.id}}.</strong>
            <p>
                Leshan will not be able to generate a correct form and encode/decode value correctly.
                As best effort, Leshan will consider all resources as RW OPAQUE.
            </p>
            <p><a href="https://github.com/eclipse/leshan/wiki/Adding-new-objects#leshan-server-demo" target="_blank">Use
                --modelsfolder</a> to add the object model definition.</p>
        </div>
        <div class="form-group" ng-show="showinstanceid" show-errors>
            <label class="col-sm-4 control-label" for="instanceid">Instance ID {{object.name}}</label>
            <div class="col-sm-8">
                <input class="form-control" id="instanceid" name="instanceid" ng-model="instance.id"
                       placeholder="Let this field empty to let the client choose an Id"/>
            </div>
        </div>
        <resourceform ng-repeat='resource in instance.resources' parent='instance' resource='resource'></resourceform>
    </form>
</div>
<div class="modal-footer">
    <button class="btn btn-default" ng-click="cancel()">Cancel</button>
    <button class="btn btn-primary" ng-click="submit(false)">{{oklabel}}</button>
    <button class="btn btn-primary" ng-click="submit(true)" ng-show="showReplace">Replace</button>
</div>